import Vue from 'vue'
import Router from 'vue-router'
import Register from '@/views/Register'
import Login from '@/views/Login'
import PersonInfo from '@/views/PersonInfo'
import GoodsList from '@/views/GoodsList'
import Cart from '@/views/Cart'
import AddressList from '@/views/AddressList'
import ForgetPassword from '@/views/ForgetPassword'
import GoodsDetails from '@/views/GoodsDetails'
import AddressData from '@/views/infoMenuViews/AddressData'
import AllOrder from '@/views/infoMenuViews/AllOrder'
import PersonalData from '@/views/infoMenuViews/PersonalData'

Vue.use(Router)

export default new Router({
	mode: 'history',
	routes: [{
			path: '/Login',
			name: 'Login',
			component: Login
		},
		{
			path: '/Register',
			name: 'Register',
			component: Register
		},
		{
			path: '/',
			name: 'GoodsList',
			component: GoodsList,
			//redirect : "GoodsList",  // 路由重定向
			children: []
		},
		{
			path: '/AddressList',
			name: 'AddressList',
			component: AddressList
		},
		{
			path: '/PersonInfo',
			name: 'PersonInfo',
			component: PersonInfo,
			children : [
				{
					path : '/PersonalData',
					name : 'PersonalData',
					component : PersonalData
				},
				{
					path : '/AddressData',
					name : 'AddressData',
					component : AddressData
				},
				{
					path : '/AllOrder',
					name : 'AllOrder',
					component : AllOrder
				}
			]
		},
		{
			path: '/Cart',
			name: 'Cart',
			component: Cart
		},
		{
			path: '/ForgetPassword',
			name: 'ForgetPassword',
			component: ForgetPassword
		},
		{
			path: "/GoodsDetails",
			name: "GoodsDetails",
			component: GoodsDetails
		}
	]
})